//
//  AccountsReceivableDetailViewController.swift
//  HuaYun
//
//  Created by enghou on 2018/11/16.
//  Copyright © 2018 xyxorigation. All rights reserved.
//

import UIKit

class AccountsReceivableDetailViewController: PotentialDetailViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
    }
    
    override func path(for name: String) -> String {
        return accountsReceivableDetail
    }
    
    override func configTitles() -> Array<String> {
        return ["合同信息","应收账款信息","开票明细","应收账款动态"]
    }
    
    override func configViewControllers() -> [UIViewController] {
        return [TitleContentTableViewController(),TitleContentTableViewController(),TitleContentTableViewController(),TitleContentTableViewController()]
    }

    override func success(for name: String) -> NetSuccess {
        func suc(json: JSON)->Void{
            print(json)
//            if let success = json.contents?["success"]?.bool {
//                if success == true {
//                    print(json.contents?["data"])
//                    if let data = json.contents?["data"] {
//                        var contents: Array<Dictionary<String,String?>> = []
//                        contents.append(["合同名称":data.contents?["contractName"]?.rawString()])
//                        contents.append(["合同编号":data.contents?["contractId"]?.rawString()])
//                        contents.append(["K2编号":data.contents?["k2num"]?.rawString()])
//                        let signMoney = (data.contents?["signMoney"]?.int ?? 0) / 100
//                        contents.append(["合同签订金额(元)":String(signMoney)])
//                        contents.append(["合同决算金额(元)": "接口无此参数"])
//                        contents.append(["签订日期":data.contents?["contractId"]?.rawString()])
//
//                        
//                    }
//                } else {
//                    self.alert(json.contents?["errorMsg"]?.rawString())
//                }
//            }
        }
        return suc
    }
    
}
